
/*重复数组
// set
function u1(arr){
    // return Array.from(new Set(arr))
    return [...new Set(arr)]
}

// indexOf索引
function u2(origin){
    let target=[]
    for(let i=0;i<origin.length;i++){
        if(target.indexOf(origin[i])==-1){
            target.push(origin[i])
        }
    }
    return target
}

// includes元素值
function u3(origin){
    let target=[]
    for(let i=0;i<origin.length;i++){
        if(!target.includes(origin[i])){
            target.push(origin[i])
        }
    }
    return target
}
a=[1,3,3,'ee']
console.log(u3(a))
*/

/*定时
var timer=setInterval(()=>{
    console.log('hello')
},1000)
window.clearInterval(timer)

let timer=setTimeout(()=>{
    console.log('hello')
},1000)
window.clearInterval(timer)
*/

/*闭包
function bi(){
    var a=1
    function out(){return a}
    return out
}
let p=bi()
console.log(p())
 */


/*bind
(()=>console.log('hh'))()

var color='red';
let o={color:'blue'}
function go(){
    console.log(this.color)
}
go()
go().call(this)
go().call(o)

function saycolor(){
    console.log(this.color)
}
saycolor.bind(o)()
*/

test('描述',()=>{
    expect(fun(参数)).toBe(结果)
})